BuffEffect17 = BaseBuffEffect:new();
BuffEffect17.__index = BuffEffect17;

function BuffEffect17:new()
    local object = {};
    setmetatable(object, BuffEffect17);
    return object;
end

function BuffEffect17:action(fight,buff,...)
    local target = buff.target;
    local num = 0;
    local fighters = fight.teams[1 - target.teamIndex].fighters;
    for i=1,#fighters do
        if not FighterManager.isDie(fighters[i]) then
            num = num + 1;
        end
    end

    BaseBuffEffect:resetAttribute(fight,buff);
    local values = decodeJsonStrToTabel(buff.buffBean.f_Value);
    if num <= values[1] then
        BaseBuffEffect:addAttribute(fight,buff,values,2);

        fightLog("[EFFECT]Fighter "..buff.target.fighterId.." Buff"..buff.modelId.." 触发场上敌方单位少于等级X增加属性效果，增加属性["..values[2].."]："..values[3]);
    end
    return EnumConst.IBuffEffect.RESET;
end
